<%@page contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<script type="text/javascript">
    $.ready(function(){
        $("#test").change(function(){
               alert("改变了");
               $("#result").val($("#test").val());
        });
    });
</script>
<style type="text/css" media="screen">
    .my-uploadify-button {
        background:none;
        border: none;
        text-shadow: none;
        border-radius:0;
    }

    .uploadify:hover .my-uploadify-button {
        background:none;
        border: none;
    }

    .fileQueue {
        width: 400px;
        height: 150px;
        overflow: auto;
        border: 1px solid #E5E5E5;
        margin-bottom: 10px;
    }
</style>
<div class="pageContent">
	<form:form modelAttribute="product"   action="${ctx}/product/insert?navtabid=productNav"  method="post"   onsubmit="return validateCallback(this, dialogAjaxDone);">
	<div class="pageFormContent" layoutH="58">
			<input type="hidden" id="id" name="id" />
			<p>
				<label>产品名称:</label>
				<input name="name"   type="text"  />
			</p>
			<p>
				<label>产品编号:</label>
				<input name="number"   type="text" />
			</p>
			<p>
				<label>描述:</label>
				<input name="description"   type="text" />
			</p>
            <p>
            <label>类别名称:</label>
            <input name="productCategory.name"  id="categoryname" type="text"  readonly/>
            <input name="productCategory.id" id="test" value="" type="hidden"/>
                <a class="btnLook" href="${ctx}/product/lookup" rel="lookup"  lookupGroup="productCategory" title="产品类别" width="400" >查找带回</a>
            </p>

			<p>
				<label>价格:</label>
				<input name="price"  type="text"  class="number" />
			</p>
            <div class="divider"></div>
        <input id="testFileInput2" type="file" name="image2"
               uploaderOption="{
			swf:'${ctx}/resources/dwz/uploadify/scripts/uploadify.swf',
			uploader:'${ctx}/product/upload',
			formData:{PHPSESSID:'xxx', ajax:1},
			queueID:'fileQueue',
			buttonImage:'${ctx}/resources/dwz/uploadify/img/add.jpg',
			buttonClass:'my-uploadify-button',
			width:102,
			auto:true,
			onUploadSuccess:function(file, data, response){
                $('#result').html($('#result').html()+'<br>'+data) ;
                $('#fileArray').val($('#fileArray').val()+','+data) ;
            }
		}"
                />

                <div id="fileQueue" class="fileQueue"></div>
                <div id="result" style=""></div>
                <input id="fileArray" type="text" name="fileArray" />
        <div class="divider"></div>
		</div>
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="reset">清空</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">关闭</button></div></div></li>
			</ul>
		</div>
</form:form>
</div>
